﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace Diary.Win
{
    public partial class AuthenticationForm : Form
    {
        public AuthenticationForm()
        {
            InitializeComponent();
        }

        
        private void btnVerify_Click(object sender, EventArgs e)
        {
            string input = CommonLib.MD5.Encry16(tbxPassword.Text);
            string save = BAL.Setting.get_string_value("Password");
            if (string.IsNullOrEmpty(save))
            {
                save = CommonLib.MD5.Encry16("123456");
            }
            if (input == save)
            {
                DialogResult = DialogResult.Yes;
                this.Close();
            }
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
